#ifndef PATTERNFINDER_H
#define PATTERNFINDER_H

#include <string>
#include <iostream>
#include <map>
#include "ParametersParser.h"
#include "SynchronousFinder.h"
#include "AsynchronousFinder.h"
//#include "Finders.h"



template <typename finder = SynchronousFinder>
class PatternFinder {
    public:
        PatternFinder(std::map<const char*, bool> _parameters, std::vector<std::string> _files, std::string _pattern); // { };
        virtual ~PatternFinder();
        // zwracany typ nie ma być void ino jakiś obiekt przechowujący znalezione informacje
        void find();
    protected:
    private:
        finder*             m_finder;
};

// definicje
template <typename finder>
PatternFinder<finder>::PatternFinder(std::map<const char*, bool> _parameters, std::vector<std::string> _files, std::string _pattern) {
        m_finder = new finder();
        m_finder->setParameters(_parameters);
        m_finder->setFiles(_files);
        m_finder->setPattern(_pattern);
        m_finder->find();

        delete m_finder;
}

template <typename finder>
PatternFinder<finder>::~PatternFinder()
{

}

template <typename finder>
void PatternFinder<finder>::find() {
    finder::find();
}

#endif // PATTERNFINDER_H
